﻿using System.Collections.Generic;
using System.Runtime.Serialization;

namespace CoreLibrary.Paging {

    [DataContract]
    public class JSONSearchRequest {

        [DataMember]
        public bool MatchAll { get; set; }

        [DataMember]
        public int Offset { get; set; }

        [DataMember]
        public int Limit { get; set; }

        [DataMember]
        public List<SearchCriteria> Criterias { get; set; }

        public JSONSearchRequest() {
            Criterias = new List<SearchCriteria>();
        }
    }

    public class SearchCriteria {

        [DataMember]
        public string Field { get; set; }

        [DataMember]
        public string Data { get; set; }

        [DataMember]
        public string Opertaion { get; set; }
    }

    public class Operations  {
        public const int Contains         = 1;
        public const int DoesNotContain   = 2;
        public const int Equal            = 3;
        public const int NotEqual         = 4;
        public const int BeginsWith       = 5;
        public const int DoesNotBeginWith = 6;
        public const int EndsWith         = 7;
        public const int DoesNotEndWith   = 8;
        public const int GreaterThan      = 9;
        public const int SmallerThan      = 10;
        public const int MoreThan         = 11;
        public const int LessThan         = 12;

    }

}